#include "cmsis_os.h"
#include "usbd_cdc_if.h"
#include "Current_Ring.h"
#include "value_display.h"
#include "Current_ring.h"
#include "High_ring.h"
#include "Mag_sensor.h"
#include "adc_monitor.h"
#include "shell.h"
#include "changeable_values.h"
#include "axis.h"

void motor_state(){
	uint8_t data;
	sprintf(tx, "Press any key to exit\r\n");
	VUSB_send_data((uint8_t*)tx,strlen(tx),5);  
	while(VUSB_receive_data(&data,1,2)!=USBD_OK){
		sprintf(tx, "Bus_Voltage:%f Mos_Temperature:%f Round/s:%f",axis1.drive.Bus_Voltage,axis1.drive.Mos_Temperature,axis1.motor.rps);
		VUSB_send_data((uint8_t*)tx,strlen(tx),5); 
		vTaskDelay(100);
		memset(tx,'\b',strlen(tx));
		VUSB_send_data((uint8_t*)tx,strlen(tx),5);
	}
	VUSB_send_data((uint8_t*)"\r\n",2,5);
}
SHELL_EXPORT_CMD_AGENCY(SHELL_CMD_TYPE(SHELL_TYPE_CMD_FUNC),
motor_state,motor_state,display motor state);
